package com.medusa.aps.business.modules.demand.model.output;

import com.medusa.aps.business.util.PercentageScheduleUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author miskw
 * @date 2024/1/9
 */
@Data
@Schema(description = "排程明细-工序明细返回结果")
public class ScheduleProcessDetailsVO {
    /**
     * 订单号
     */
    @Schema(description = "订单号")
    private String orderNumber;
    /**
     * 物料编码
     */
    @Schema(description = "物料编码")
    private String materialCode;
    /**
     * 物料名称
     */
    @Schema(description = "物料名称")
    private String materialName;
    /**
     * 车间名称
     */
    @Schema(description = "车间名称")
    private String workshopName;
    /**
     * 工序号
     */
    @Schema(description = "工序号")
    private Integer processNumber;
    /**
     * 工序编码
     */
    @Schema(description = "工序编码")
    private String processCode;
    /**
     * 工序名称
     */
    @Schema(description = "工序名称")
    private String processName;
    /**
     * 工序描述
     */
    @Schema(description = "工序描述")
    private String processDescription;
    /**
     * 设备编码
     */
    @Schema(description = "设备编码")
    private String equipmentCode;
    /**
     * 设备名称
     */
    @Schema(description = "设备名称")
    private String equipmentName;
    /**
     * 辅助资料编码
     */
    @Schema(description = "辅助资料编码")
    private String auxiliaryDataCoding;
    /**
     * 辅助资料名称
     */
    @Schema(description = "辅助资料名称")
    private String auxiliaryDataName;
    /**
     * 需求数量
     */
    @Schema(description = "需求数量")
    private Integer demandQuantity;
    /**
     * 计划数量
     */
    @Schema(description = "计划数量")
    private Integer plannedQuantity;
    /**
     * 已完工数量
     */
    @Schema(description = "已完工数量")
    private Integer completedQuantity;
    /**
     * 工序进度
     */
    @Schema(description = "工序进度")
    private String processSchedule;
    /**
     * 计划开始时间
     */
    @Schema(description = "计划开始时间")
    private LocalDateTime plannedStartTime;
    /**
     * 计划结束时间
     */
    @Schema(description = "计划结束时间")
    private LocalDateTime plannedEndTime;
    /**
     * 实际结束时间
     */
    @Schema(description = "实际结束时间")
    private LocalDateTime actualEndTime;

    @SuppressWarnings("unused")
    public void setProcessSchedule(BigDecimal processSchedule) {
        this.processSchedule = PercentageScheduleUtils.decimalConvertPercentage(processSchedule);
    }

}
